package com.atguigu.gulimall.product.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.atguigu.gulimall.product.entity.SpuImage;
import com.atguigu.gulimall.product.service.SpuImageService;
import com.atguigu.gulimall.product.mapper.SpuImageMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author nicc
 * @description 针对表【spu_image(商品图片表)】的数据库操作Service实现
 * @createDate 2022-09-26 18:25:42
 */
@Service
public class SpuImageServiceImpl extends ServiceImpl<SpuImageMapper, SpuImage>
        implements SpuImageService{

    @Override
    public List<SpuImage> spuImageListBySpuId(Long spuId) {
        LambdaQueryWrapper<SpuImage> queryWrapper = new LambdaQueryWrapper<SpuImage>()
                .eq(SpuImage::getSpuId, spuId);

        List<SpuImage> result = this.list(queryWrapper);

        return result;
    }
}